﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

/// <summary>
/// 拖动悬浮按钮
/// </summary>
public class ButtonDragView : MonoBehaviour, IDragHandler,IBeginDragHandler,IEndDragHandler
{

    public  Transform buttonTrans;

    public void OnBeginDrag(PointerEventData eventData)
    {
        CallUpButtons.Instance.HideButtons();
    }

    public void OnDrag(PointerEventData eventData)
    {
        buttonTrans.position = Input.mousePosition;
    }

    public void OnEndDrag(PointerEventData eventData)
    {
        if (CallUpManager.Instance.IsExit_Pet == true)
        {
            CallUpButtons.Instance.ShowButtons();
        }       
    }
}
